<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
        <input type="checkbox" name="fun" >运动
        <input type="checkbox" name="fun" >唱歌
        <input type="checkbox" name="fun" >写代码
    
        <input id="allcheck" type="checkbox">全选

        <button disabled>现在提交</button>

        <script>
            var funs = document.querySelectorAll('input[name="fun"]');
            var allcheck = document.querySelector('#allcheck');
            var btn = document.querySelector('button');

            check();

            for(var i=0;i<funs.length;i++){
                funs[i].onclick = function(){
                    check();
                }
            }

            function check(){
                allcheck.checked = [...funs].every(item=>{
                    return item.checked
                })

                var isabled = [...funs].some(item=>{
                    return item.checked
                })
                btn.disabled = !isabled;
            }

            // allcheck.checked = [...funs].every(item=>{
            //     return item.checked
            // })

            // console.log(ischecked)
        </script>
</body>
</html>